Add Jest E2E tests for trueforge-core - #431
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a3b6b85. Configure here.
a3b6b85 to
f0a0848
Compare
| required_actions: [EventType.TOOL_APPROVAL_REQUIRED], | ||
| root_agent_error: null, | ||
| }, | ||
| context: [ |
There was a problem hiding this comment.
Let us please make this as what is the input to LLM in turn 1.
| }, | ||
| ]; | ||
|
|
||
| const EXPECTED_CHILD_LLM_INPUT = [ |
There was a problem hiding this comment.
We do not need to test this at the moment.
If you test the root, we are mostly in good shape.
|
|
||
| const EXPECTED_ROOT_LLM_INPUT = [ | ||
| { | ||
| stream: true, |
There was a problem hiding this comment.
We can skip this.

Summary
Adds a Jest E2E harness for
@truefoundry/trueforge-corewith a mocked LLM and a first orchestrator loop test.Changes
tests/e2etree andjest.e2e.config.cjs, kept out of unit Jestpnpm test:e2e/pnpm test:trueforge-core:e2e; corepnpm testruns units then E2EAgentThreadOrchestratorHow was this tested?
pnpm --filter @truefoundry/trueforge-core test:e2epnpm --filter @truefoundry/trueforge-core typecheckChecklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Low Risk
Changes are limited to tests, Jest config, npm scripts, and editor launch settings; no production runtime or API behavior is modified.
Overview
Introduces a dedicated orchestration Jest harness under
packages/trueforge-core/tests/orchestrationthat exercisesAgentThreadOrchestratorandAgentThreadwith mocked LLMs and no store/DB, matching production’ssendthenexecuteflow.Test wiring:
jest.orchestration.config.cjsruns only that folder (maxWorkers: 1, 60s timeout); the default unitjest.config.cjsignorestests/orchestration/. Corepnpm testnow runs unit Jest then orchestration Jest. Root and package scripts addtest:orchestration,test:orchestration:debug, and repo-leveltest:trueforge-core:orchestration(+ debug). VS Code launch config targets debugging the current orchestration test file.Coverage added: shared helpers (
runTurn, scriptedILLMstreams, approval-gatedwrite_notetool set) plus three scenarios—text-only happy path,create_sub_agentdelegation with child result routed to parent, and pause/resume on tool approval. A README documents turn lifecycle, events, and how this maps toSessionHandle.Reviewed by Cursor Bugbot for commit ee2791b. Bugbot is set up for automated code reviews on this repo. Configure here.